import request from '@/utils/request'

export function newOperatorCount() {
  return request({
    url: '/online/management/admin/dashboard/operator/trend/new',
    method: 'GET'
  })
}

export function operatortopMerchant() {
  return request({
    url: '/online/management/admin/dashboard/operator/top/merchant',
    method: 'GET'
  })
}

// 获取设备数量、激活设备数量的汇总数据

export function getDeviceSummary(params) {
  return request({
    url: '/online/management/admin/dashboard/device/summary',
    method: 'GET',
    params
  })
}
// 获取设备数量、激活设备数量近N天的统计结果
export function getDeviceTrend(params) {
  return request({
    url: '/online/management/admin/dashboard/device/recent-record',
    method: 'GET',
    params
  })
}
// 获取指令数量近N天/N月的统计结果
export function getCMDTrend(params) {
  return request({
    url: '/online/management/admin/dashboard/cmd-total/trend',
    method: 'GET',
    params
  })
}
// 获取应用安装趋势
export function getInstallTrend(params) {
  return request({
    url: '/online/management/statistic/application/install/count/trend',
    method: 'GET',
    params
  })
}
// 获取应用下载进度
export function getDownloadTrend(params) {
  return request({
    url: '/online/management/statistic/application/download/process',
    method: 'GET',
    params
  })
}
// 获取设备在线数量趋势
export function getOnlineDeviceByHour(params) {
  return request({
    url: '/online/management/admin/dashboard/device-online/trend',
    method: 'GET',
    params
  })
}
// 获取设备在线数量趋势
export function getOnlineDeviceByDay(params) {
  return request({
    url: '/online/management/admin/dashboard/trend/online',
    method: 'GET',
    params
  })
}

// 获取总的在线设备
export function getOnlineTotalDevice(params) {
  return request({
    url: '/online/management/admin/dashboard/online/device/count',
    method: 'GET',
    params
  })
}
// 获取运营商/开发者总数和N天内活跃数量
export function getUserActivity(params) {
  return request({
    url: `/online/management/admin/dashboard/character/${params.characterCode}/counts`,
    method: 'GET',
    params
  })
}

// 获取应用商店应用数量
export function getAppstoreCount(params) {
  return request({
    url: `/online/management/statistic/application/all/count`,
    method: 'GET',
    params
  })
}

// 查询所以设备类型
export function selectAllModel(params) {
  return request({
    url: '/online/management/datacenter/device/query/all/model',
    method: 'get',
    params
  })
}